package com.luo.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.luo.constant.MessageConstant;
import com.luo.entity.Result;
import com.luo.pojo.SetMeal;
import com.luo.service.SetMealService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Zoro
 * @date 2021年08月29
 */
@RestController
@RequestMapping("/setMeal")
public class SetMealController {

    @Reference
    private SetMealService setMealService;

    @RequestMapping("/getSetMeal.do")
    public Result getSetMeal() {

        return new Result(true, MessageConstant.QUERY_SETMEALLIST_SUCCESS, setMealService.selectAll());
    }

    @RequestMapping("/findById.do")
    public Result findById(Integer id) {
        SetMeal setMeal = setMealService.selectSetMealDetailById(id);
        return new Result(true, MessageConstant.QUERY_SETMEAL_SUCCESS, setMeal);
    }

    @RequestMapping("/findBasic.do")
    public Result findByIdBasic(Integer id) {
        SetMeal setMeal = setMealService.getSetMealById(id);
        return new Result(true, MessageConstant.QUERY_SETMEAL_SUCCESS, setMeal);
    }

}
